package dialer.ws.base.entity.vtelcom;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "formulary_detail", schema = "vtelcom_call_center")
public class FormularyDetail implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8803722501446541361L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false)
	private int id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_column_type", nullable = false)
	private ColumnType columnType;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_formulary", nullable = false)
	private Formulary formulary;

	@Column(name = "name", nullable = false)
	private String name;

	@Column(name = "position", nullable = false)
	private Integer position;
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "formularyDetail")
	private List<ListDetail> listDetail;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Formulary getFormulary() {
		return formulary;
	}

	public void setFormulary(Formulary formulary) {
		this.formulary = formulary;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getPosition() {
		return position;
	}

	public void setPosition(Integer position) {
		this.position = position;
	}

	public ColumnType getColumnType() {
		return columnType;
	}

	public void setColumnType(ColumnType columnType) {
		this.columnType = columnType;
	}

	public List<ListDetail> getListDetail() {
		return listDetail;
	}

	public void setListDetail(List<ListDetail> listDetail) {
		this.listDetail = listDetail;
	}

}